|
|
|
|
|
|
|
You learned that there are three levels of locking available to Visual Basic programs: |
|
|
|
|
|
|
|
|
· The database levelYou can use the Exclusive property of the data control or the second parameter of the OpenDatabase method to lock the entire database. Use this option when you need to perform work that affects multiple database objects (such as tables, queries, indexes, relations, and so on). |
|
|
|
|
|
|
|
|
· The table levelYou can set the Options property of the data control to 3 or the third parameter of the OpenRecordset method to dbDenyRead+dbDenyWrite in order to lock the entire table for your use only. Use this option when you need to perform work that affects multiple records in a single table (for example, increasing the sales price on all items in the inventory table). |
|
|
|
|
|
|
|
|
· The page levelMicrosoft Jet automatically performs page-level locking whenever you use the data control to edit and save a record, or whenever you use Visual Basic code to perform the Edit/AddNew and Update/CancelUpdate methods. You can use the LockEdits property of the Recordset to set the page locking to pessimistic (to perform locking at edit time) or optimistic (to perform locking only at update time). |
|
|
|
|
|
|
|
|
You learned how to use Visual Basic to enforce referential integrity and automatically perform cascading updates or deletes to related records. You learned that there are times when it is not advisable to establish cascading deletes (for example, do not use cascading deletes when the base table is a validation list and the foreign table is a master). |
|
|
|
|
|
|
|
|
Finally, you learned how to use database transactions to protect your database during extended, multitable operations. You learned how to use the BeginTrans, CommitTrans, and Rollback methods of the workspace object. And you learned some of the advantages and limitations of transaction processing. |
|
|
|
|
|
|
|
|
Day 18
Using the Remote Data Control and the Remote Data Objects |
|
|
|
|
|
|
|
|
On Day 18, you learned about two alternate methods for accessing remote data. You learned that you can use the Remote Data control to create simple data entry forms with data-bound controls. You also learned to use the Remote Data Objects to create Visual Basic 5.0 programs that can access data from a remote RDBMS. |
|
|
|
|
|
|
|
|
Along with the details of the Remote Data Control and the Remote Data objects, you also learned some of the basics of remote data access in general. You learned about: |
|
|
|
|
|
|
|
|
· Cursor driversThese are the tools that manage the location of the Recordset pointer in a dataset. You learned you can use client-side or server-side cursor drivers with RDC/RDO connections. |
|
|
|
|
|